/*
 * Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Description: singly list
 * This file should be changed only infrequently and with great care.
 */

#ifndef __DFX_SINGLY_LIST_H__
#define __DFX_SINGLY_LIST_H__
#include "td_base.h"
#include "soc_errno.h"
#include "zdiag_config.h"

typedef struct dfx_singly_list_node {
    struct dfx_singly_list_node *next;
} dfx_singly_list_node;

typedef struct {
    dfx_singly_list_node *head;
    dfx_singly_list_node *tail;
} dfx_singly_list;

td_void dfx_singly_list_init(dfx_singly_list *list);
td_void dfx_singly_list_push_node(dfx_singly_list *list, dfx_singly_list_node *node);
dfx_singly_list_node *dfx_singly_list_pop_node(dfx_singly_list *list);
dfx_singly_list_node *dfx_singly_list_get_first_node(dfx_singly_list *list);

#endif
